I need to compare two binary files and get the output in the form <fileoffset-hex> <file1-byte-hex> <file2-byte-hex> for every different byte.
Use the --binary option to force diff to read and write binary data instead. This option has no effect on a POSIX-compliant system like GNU or traditional Unix.
The diff command will compare two files for you, and highlight the differences. It can even provide a few lines on either side of the changes to provide some ... Comparing Binary Files · Secure Hash Algorithms · Finding the Differences